<template>
	<div class="newCard">
		<div class='newCard_top'>
			<p class="newCard_topP1">温馨提示</p>
			<ul style="padding-bottom: 0.5rem;">
				<li class="newCard_topP2">·请认真填写、核实账户信息，如信息有误，后果自负；</li>
				<li class="newCard_topP2">·更改、删除、增加账户都需输入验证码；</li>
				<li class="newCard_topP2">·验证码发至注册手机号；</li>
				<li class="newCard_topP2">·每个用户限绑定两个收款账户；</li>
				<li class="newCard_topP2">·收款账户只限国内银行；</li>
			</ul>
		</div>
		<div class="Jregister_body">
			<div class="Jregister_body_input flex align_center">
				<div class="Jregister_body_name">银行</div>
				<input type="text" class="flex1" placeholder="xx银行" v-model="message.bank"/>
			</div>
			<div class="Jregister_body_input flex align_center">
				<div class="Jregister_body_name">开户行</div>
				<input type="text" class="flex1" placeholder="xx分行（支行）" v-model="message.bank_account" />
			</div>
			<div class="Jregister_body_input flex align_center">
				<div class="Jregister_body_name">持卡人</div>
				<input type="text" class="flex1" placeholder="请输入持卡人姓名" v-model="message.cardholder" />
			</div>
			<div class="Jregister_body_input flex align_center">
				<div class="Jregister_body_name">卡号</div>
				<input type="text" class="flex1" placeholder="xxxx xxxx xxxx xxxx" v-model="message.card_num" />
			</div>
			
			<div class="Jregister_body_input flex align_center">
				<div class="Jregister_body_name">验证码</div>
				<input type="text" class="flex1" placeholder="发送至注册手机号" v-model="message.sms_code" />
				<v-Code></v-Code>
			</div>
		</div>
		<el-button round class='Jregister_body_button' @click='jump'>确认</el-button>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui';
	import vCode from '../../common/yzm.vue';
	export default {
		components:{
            vCode
        },
		data: function() {
			return {
				
				message:{},
			}
		},
		mounted() {
			if(this.$route.query.messageData){
				this.message=JSON.parse(this.$route.query.messageData);
				this.message.sms_code='';
			}
		},
		methods: {
			
			
			jump(){
				for(let i in this.message){
					if(this.message[i]==''){
						Toast('请先填写数据')
						return false;
					}
				}
				if(this.$route.query.messageData){
					this.message.member_id=window.uid;
					this.message.account_id=this.message.id
					this.ajax(this, {
						'url': this.defines.edit_account,
						'type': 'post',
						'data':this.message,
						'callback': data => {
							if(data.data.error_code==0) {
								Toast('编辑成功')
								window.history.go(-1);
	
							} else {
								Toast(data.data.error_msg)
							}
	
						},
						'errorback': errory => {
	
						},
	
					})
				}
				
				
			}
		}
	}
</script>

<style scoped>
	.newCard_top{
		background: url('../../../../static/img/images/logo4.jpg') 100%;
		background-size: 100%;
		width: 100%;
		padding-top: 2rem;
	}
	.newCard_topP1{
		color: #fff;
		width: 94%;
		padding: 0 3%;
		font-size: 1.8rem;
		line-height: 2rem;
		margin-bottom: 1rem;
	}
	.newCard_topP2{
		font-size: 1.2rem;
		color: #ccc;
		
		width: 94%;
		padding: 0 3%;
		list-style-type:disc;
		padding-bottom: 0.5rem;
	}
	.Jregister_body{
		width: 86%;
		margin: 2rem auto;
		
	}
	.Jregister_body_input{
		height: 3rem;
		width: 100%;
		margin-bottom: 2rem;
	}
	.Jregister_body_name{
		width: 5rem;
		text-align: right;
		font-size: 1.6rem;
		margin-right: 1.6rem;
	}
	.Jregister_body_input input{
		height: 3rem;
		font-size: 1.4rem;
		line-height: 1.6rem;
		background: #e6e6e6;
		color: #000000;
		border-radius: 0.4rem;
		text-indent: 0.5rem;
	}
	
	.Jregister_body_button{
		width: 65%;
		background: #000;
		color: #f7bd40;
		font-size: 1.6rem;
		margin: 0 auto;
		display: block;
		margin-top: 5rem;
	}
	
</style>